# makefile for compiling test
# the makefile also creates an executable file test for testing
# this makefile assumes that itLib is fresh and available
# this is solved in the project by the Makefile in parent directory

OBJ =  main.o test_word32.o test_word64.o testBitVector32.o test_lfsr32.o
INC = ../include
CFLAGS = -std=c++11 -Wall
LDIR = ../lib
vpath %.h ../include

#create/link test
test: $(OBJ) $(LIB)/libitLib.a 
	g++ $(CFLAGS) -o test $(OBJ) -L $(LDIR) -litLib

#compile main
main.o: main.cpp
	g++ $(CFLAGS) -c -I $(INC) main.cpp

#compile test_word32
test_word32.o: test_word32.cpp 
	g++ $(CFLAGS) -c -I $(INC) test_word32.cpp

#compile test_word64
test_word64.o: test_word64.cpp 
	g++ $(CFLAGS) -c  -I $(INC) test_word64.cpp

#compile test_BitVector
testBitVector32.o: testBitVector32.cpp 
	g++ $(CFLAGS) -c -I $(INC) testBitVector32.cpp

#compile test_lfsr32
test_lfsr32.o: test_lfsr32.cpp
	g++ $(CFLAGS) -c -I $(INC) test_lfsr32.cpp

$(LIB)/libitLib.a:
	cd ../lib && $(MAKE)

#removing binary and object files
clean: 
	rm -f test *.o *~





